<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    var greatestLetter = function (s) {
      for (let i = 25; i >= 0; i--) {
        if (s.match(String.fromCharCode(i + 'a'.charCodeAt())) &&
          s.match(String.fromCharCode(i + 'A'.charCodeAt()))) {
          return String.fromCharCode(i + 'A'.charCodeAt());
        }
      }
      return '';
    };
    console.log(greatestLetter(s = "lEeTcOdE"))
  </script>
</body>

</html>